﻿using System;
using System.Globalization;
using System.Linq;
using Huyn.MultiBinding;

namespace UniversalApp_Sample.MultiConverters
{
    public class ConcatMultiConverter:IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values == null || !values.Any())
                return "";
            return values.Where(v=>v!=null).Select(v => v.ToString()).Aggregate((a,b)=>a+" "+b);
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
